home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
questMarriage.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
4KB
|
130 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questMarriage entered");
setState("initial");
end )
-- on game over: relationship conditions get reset to 0 and all quests are reset to initial
onMsg("questreset", function(msg)
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
--onDefault( function(msg)
--print("~~~~~~~~~~ questMarriage: "..getState());
--end )
state("initial")
onMsg("checkCondition", function(msg)
-- check if questTroubleTheEnda has already started
if getParent().questTroubleTheEnda.getState() ~= "initial" then
setState("done");
end
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
local friendship = min(mike.getRelationshipCondition(ELAINE, REL_FRIENDSHIP),
elaine.getRelationshipCondition(MIKE, REL_FRIENDSHIP));
local romantic = min(mike.getRelationshipCondition(ELAINE, REL_ROMANTIC),
elaine.getRelationshipCondition(MIKE, REL_ROMANTIC));
local erotic = min(mike.getRelationshipCondition(ELAINE, REL_EROTIC),
elaine.getRelationshipCondition(MIKE, REL_EROTIC));
if ( -- condition here
min(min(friendship, romantic), erotic) >= 10
-- and getParent()["questFriendship10"].getState() == "done"
-- and getParent()["questRomance10"].getState() == "done"
-- and getParent()["questErotic10"].getState() == "done"
)
then
-- cancel all quests that got stuck
--getParent().sendMsgThis("cancelQuest");
setState("okDelayQuestion");
end
end )
state("okDelayQuestion")
onEnter( function(msg)
--print(";;;;;;;;;;;;;;;;;;;;; marryMeRpg");
sendDelayedMsgThis("goAskHer", 60*1000);
--setDelayedState("talktome", 60*1000);
end )
onMsg( "goAskHer", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
-- go to talk position
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questMarriage");
setState("talktome");
end )
state("talktome")
-- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
onMsg("talking", function(msg)
if (msg.data == "questMarriage") then
popupConversation("dialogMarriage");
setState("donetalktome");
end
end )
state("donetalktome");
-- last dialog box clicked away
onMsg("yes", function(msg)
-- cancel
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
mike.cancelAllActivities(); --mike.cancelCurrentActivity();
elaine.cancelAllActivities(); --elaine.cancelCurrentActivity();
setState("talktome2");
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questMarriage");
elaine.queueCommand("pm_kissSexy", "kiss", mike, "Sexy", false);
--mike.pushCommand("pm_kissSexy", "kiss", elaine, "Sexy" );
--mike.queueCommand("pm_kissSexy", "kiss", elaine, "Sexy");
--mike.pushCommand("pm_talkCutscene", "talkCutscene", elaine, "");
--mike.pushCommand("pm_kissIntimate", "kiss", elaine, "Intimate");
end )
state("talktome2")
onMsg("talking", function(msg)
if (msg.data == "questMarriage") then
popupConversation("dialogMarriage2");
setState("donetalktome2");
end
end )
state("donetalktome2");
onMsg("yes", function(msg)
getParent().getParent().getCharacter(MIKE).cancelCurrentActivity();
getParent().getParent().getCharacter(ELAINE).cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- onEnter(function(msg)
--popupChapter("guiStoryChapterGroup4");
-- end )
-- sackgasse hier
endStateMachine()